function bpOnloadObject() {
    this.aFuncs = new Array();
    
    this.addFunc = function(newFunc) {
        this.aFuncs.push(newFunc);
    }
    
    this.execute = function() {
        for (i in this.aFuncs) this.aFuncs[i]();
    }
}



function initPreload() {
    if (typeof(window.bpOnload) == 'undefined') {
        window.bpOnload = new bpOnloadObject();
        $(window.bpOnload.execute);
    }
    return true;
}

function registerOnloadFunc(func) {
    initPreload();
    window.bpOnload.addFunc(func);
}